import router from './router'

// NProgress.configure({ showSpinner: false }) // NProgress Configuration
const title = 'NILAPP'

function getPageTitle(pageTitle) {
  if (pageTitle) {
    return `${pageTitle}-${title}`
  }
  return `${title}`
}

router.beforeEach(async (to, from, next) => {
  // set page title
  document.title = getPageTitle(to.meta.title)
  next()
})

router.afterEach(() => {
  // finish progress bar
  // NProgress.done()
})
